| Reg_id | Constraints | Invariant |
|---|
| 257 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 256 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 255 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 254 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 253 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 252 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 251 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 250 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 249 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 248 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 247 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 246 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 245 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 244 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 243 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 242 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 241 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 240 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 239 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 238 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 237 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 236 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 235 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 234 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 233 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 232 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 231 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 230 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 229 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 228 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 227 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 226 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 225 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 224 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 223 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 222 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 221 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 220 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 219 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 218 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 217 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 216 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 215 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 214 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 213 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 212 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 211 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 210 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 209 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 208 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 207 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 206 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 205 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 204 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 203 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 202 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 201 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 200 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 199 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 198 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 197 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 196 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 195 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 194 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 193 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 192 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 191 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 190 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 189 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 188 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 187 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 186 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 185 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 184 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 183 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 182 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 181 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 180 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 179 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 178 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 177 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 176 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 175 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 174 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 173 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 172 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 171 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 170 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 169 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 168 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 167 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 166 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 165 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 164 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 163 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 162 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 161 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 160 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 159 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 158 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 157 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 156 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 155 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 154 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 153 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 152 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 151 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 150 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 149 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 148 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 147 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 146 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 145 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 144 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 143 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 142 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 141 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 140 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 139 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 138 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 137 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 136 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 135 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 134 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 133 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 132 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 131 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 130 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book2)
[] 0).uncrossed_qty
= 0)not (s_id = STRAT1)
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book2)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book2 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 129 | | m |
| 128 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 127 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 126 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 125 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 124 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 123 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 122 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 121 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 120 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 119 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 118 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 117 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 116 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 115 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 114 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 113 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 112 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 111 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 110 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 109 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 108 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 107 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 106 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 105 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 104 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 103 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 102 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 101 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 100 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 99 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 98 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 97 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- (~- s.leg1.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 96 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 95 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 94 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 93 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 92 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 91 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 90 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 89 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 88 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 87 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 86 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- (~- s.leg3.leg_mult))
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 85 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- (~- s.leg3.leg_mult)) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 84 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 83 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 82 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- (~- s.leg2.leg_mult)) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 81 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult))
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 80 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 79 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 78 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 77 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 76 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 75 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 74 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 73 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- (~- s.leg2.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 72 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 71 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 70 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- (~- s.leg1.leg_mult)) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- (~- s.leg3.leg_mult))
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 69 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult))
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- (~- s.leg3.leg_mult)) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 68 | not ((~- (~- s.leg3.leg_mult)) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 67 | not ((~- (~- s.leg3.leg_mult)) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 66 | (~- (~- s.leg3.leg_mult)) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- (~- s.leg1.leg_mult)) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- (~- s.leg2.leg_mult)) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- (~- s.leg3.leg_mult))
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 65 | (~- (~- s.leg3.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- (~- s.leg2.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- (~- s.leg1.leg_mult)) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) not (sd = BUY) not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- (~- s.leg1.leg_mult)) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- (~- s.leg2.leg_mult)) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- (~- s.leg3.leg_mult)) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 64 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 63 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 62 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 61 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 60 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 59 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 58 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 57 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 56 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 55 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 54 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 53 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 52 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 51 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 50 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 49 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.bid_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 48 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 47 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 46 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 45 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 44 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 43 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 42 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 41 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 40 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 39 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 38 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 37 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 36 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 35 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 34 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 33 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) not ((~- s.leg1.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book1).bid_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 32 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 31 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 30 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 29 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 28 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 27 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 26 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 25 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 24 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.bid_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 23 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 22 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : best_bid_ask) = get_book_tops _x_5 in
let (_x_7 : int) = m.curr_time in
let (_x_8 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = _x_6} sd _x_7
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_9 : int) = _x_8.uncrossed_qty in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_1 (_x_9 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_7
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_3 (_x_9 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_7
in
let (_x_12 : uncross_res)
= allocate_implied_fills _x_5 (_x_9 * ~- s.leg3.leg_mult)
(Option.get _x_6.ask_info).li_price _x_7
in
let (_x_13 : book) = _x_8.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_10.uncrossed_book;
out_book2 = _x_11.uncrossed_book; out_book3 = _x_12.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_13.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_8.uncrossed_fills
(List.append _x_10.uncrossed_fills
(List.append _x_11.uncrossed_fills _x_12.uncrossed_fills))))
m.outbound_msgs} |
| 21 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : book) = m.out_book3 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = _x_4; book3 = get_book_tops _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_4.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_5 (_x_8 * ~- s.leg3.leg_mult) 0 _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 20 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 19 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 18 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_8 * ~- s.leg2.leg_mult) 0 _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 17 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : best_bid_ask) = get_book_tops _x_1 in
let (_x_3 : book) = m.out_book2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = _x_2; book2 = get_book_tops _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult)
(Option.get _x_2.ask_info).li_price _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 16 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 15 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 14 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 13 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.bid_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 12 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 11 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 10 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 9 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) not ((~- s.leg2.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book2).bid_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 8 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.bid_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 7 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 6 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : best_bid_ask) = get_book_tops _x_4 in
let (_x_6 : int) = m.curr_time in
let (_x_7 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = _x_5} sd _x_6
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_8 : int) = _x_7.uncrossed_qty in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_1 (_x_8 * ~- s.leg1.leg_mult) 0 _x_6
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_2 (_x_8 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_6
in
let (_x_11 : uncross_res)
= allocate_implied_fills _x_4 (_x_8 * ~- s.leg3.leg_mult)
(Option.get _x_5.ask_info).li_price _x_6
in
let (_x_12 : book) = _x_7.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_9.uncrossed_book;
out_book2 = _x_10.uncrossed_book; out_book3 = _x_11.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_12.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_7.uncrossed_fills
(List.append _x_9.uncrossed_fills
(List.append _x_10.uncrossed_fills _x_11.uncrossed_fills))))
m.outbound_msgs} |
| 5 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : best_bid_ask) = get_book_tops _x_2 in
let (_x_4 : book) = m.out_book3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = _x_3; book3 = get_book_tops _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult)
(Option.get _x_3.ask_info).li_price _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_4 (_x_7 * ~- s.leg3.leg_mult) 0 _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 4 | not ((~- s.leg3.leg_mult) > 0) not Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.bid_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 3 | not ((~- s.leg3.leg_mult) > 0) Is_a(None, (get_book_tops m.out_book3).bid_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 2 | (~- s.leg3.leg_mult) > 0 not Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : best_bid_ask) = get_book_tops _x_3 in
let (_x_5 : int) = m.curr_time in
let (_x_6 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2; book3 = _x_4}
sd _x_5
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_7 : int) = _x_6.uncrossed_qty in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_1 (_x_7 * ~- s.leg1.leg_mult) 0 _x_5
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_2 (_x_7 * ~- s.leg2.leg_mult) 0 _x_5
in
let (_x_10 : uncross_res)
= allocate_implied_fills _x_3 (_x_7 * ~- s.leg3.leg_mult)
(Option.get _x_4.ask_info).li_price _x_5
in
let (_x_11 : book) = _x_6.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_8.uncrossed_book;
out_book2 = _x_9.uncrossed_book; out_book3 = _x_10.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_11.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_6.uncrossed_fills
(List.append _x_8.uncrossed_fills
(List.append _x_9.uncrossed_fills _x_10.uncrossed_fills))))
m.outbound_msgs} |
| 1 | (~- s.leg3.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book3).ask_info) (~- s.leg2.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book2).ask_info) (~- s.leg1.leg_mult) > 0 Is_a(None, (get_book_tops m.out_book1).ask_info) sd = BUY not
((uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops m.out_book1; book2 = get_book_tops m.out_book2;
book3 = get_book_tops m.out_book3}
sd m.curr_time
with o_id = m.last_ord_id + 1} m.s_book1)
[] 0).uncrossed_qty
= 0)s_id = STRAT1
| let (_x_0 : int) = m.last_ord_id + 1 in
let (_x_1 : book) = m.out_book1 in
let (_x_2 : book) = m.out_book2 in
let (_x_3 : book) = m.out_book3 in
let (_x_4 : int) = m.curr_time in
let (_x_5 : uncross_res)
= uncross_book
(insert_order
{calc_implied_strat_order s_id s
{book1 = get_book_tops _x_1; book2 = get_book_tops _x_2;
book3 = get_book_tops _x_3}
sd _x_4
with o_id = _x_0} m.s_book1)
[] 0
in
let (_x_6 : int) = _x_5.uncrossed_qty in
let (_x_7 : uncross_res)
= allocate_implied_fills _x_1 (_x_6 * ~- s.leg1.leg_mult) 0 _x_4
in
let (_x_8 : uncross_res)
= allocate_implied_fills _x_2 (_x_6 * ~- s.leg2.leg_mult) 0 _x_4
in
let (_x_9 : uncross_res)
= allocate_implied_fills _x_3 (_x_6 * ~- s.leg3.leg_mult) 0 _x_4
in
let (_x_10 : book) = _x_5.uncrossed_book in
{m with
last_ord_id = _x_0; out_book1 = _x_7.uncrossed_book;
out_book2 = _x_8.uncrossed_book; out_book3 = _x_9.uncrossed_book;
s_book1 =
{b_buys = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_buys;
b_sells = recfun.remove_imp_orders.remove_imp_orders_side.0 _x_10.b_sells};
outbound_msgs =
List.append
(create_fill_msgs
(List.append _x_5.uncrossed_fills
(List.append _x_7.uncrossed_fills
(List.append _x_8.uncrossed_fills _x_9.uncrossed_fills))))
m.outbound_msgs} |
| 0 | | m |